<template>
  <form-label
    :label="itemConfig.label"
    :props="itemConfig.name"
    :rules="itemConfig.rules"
  >
    <component
      :is="itemConfig.type"
      :value="value"
      :options="itemConfig.options"
      @input="handleInput"
    >
    </component>
  </form-label>
</template>
<script>
import FormLabel from "./formLabel";
import * as cmps from "./components";
export default {
  components: {
    FormLabel,
    ...cmps,
  },
  props: {
    value: null,
    itemConfig: {
      type: Object | Array,
      default: () => [],
    },
  },
  data() {
    return {};
  },
  methods: {
    handleInput(val) {
      this.$emit("input", val);
    },
  },
};
</script>
